/**
 * 
 */
package com.dalonedrau.jogl.opengl.ui;

/**
 * @author Donald
 */
public interface GuiSelectableGroup extends GuiComponent {
	/**
	 * Adds a {@link GuiSelectable} item to the <code>GuiSelectableGroup</code>.
	 * @param item a {@link GuiSelectable} item
	 * @throws Exception if the item is not a valid {@link GuiSelectable} for
	 *             the group
	 */
	void addItem(GuiSelectable item) throws Exception;
	/** Remove all items from list and detach any attached Frames. */
	void clear();
	/** Clears visible highlights from all group items. */
	void clearHighlight();
	GuiSelectable findItem(int id);
	int findItemIndex(float x, float y);
	// Find an item in the GuiSelectableGroup either by name
	// or Id (name CRC)
	int findItemIndex(int id);
	/**
	 * Get the currently highlighted object (if there is one).
	 * @return {@link GuiSelectable}
	 */
	GuiSelectable getHighlighted();
	/**
	 * Get the index of the currently highlighted object (if there is one).
	 * @return <code>int</code> or -1 if no index is highlighted
	 */
	int getHighlightedIndex();
	/**
	 * Highlights an item in the list by index.
	 * @param index the list item index
	 * @return true if the highlight is possible; false otherwise
	 */
	boolean highlightIndex(int index);
	/**
	 * Highlights an item in the list by id.
	 * @param id the item's id
	 * @return true if the highlight is possible; false otherwise
	 */
	boolean highlightItem(int id);
	/**
	 * Highlights an item in the list by component name.
	 * @param name the item's name
	 * @return true if the highlight is possible; false otherwise
	 */
	//boolean highlightItem(String name);
	// Highlight the next/previous item skipping any unhighlightable
	// items and wrapping where necessary.
	boolean highlightNext();
	boolean highlightPrevious();
	// Test to see if the specified position is within
	// the GuiComponent's HotSpot.
	boolean isInHotSpot(float x, float y);
	// function called when the GuiSelectable is highlighted
	// (mouseover, menu item selected).
	boolean onHighlight(boolean highlighted);
	// function called when item is selected and activated.
	boolean onSelect();
	boolean setFocus(float x, float y);
}
